package edu.ccut.saturn.basecomponent.xmloperationcomponent;

import org.dom4j.Element;

import edu.ccut.saturn.component.DefaultComponent;
import edu.ccut.saturn.component.IParameterContext;

public class GetAttributesValue extends DefaultComponent {
	@Override
	public void execute(IParameterContext parameterContext) throws Exception {
		
		Element root = (Element)parameterContext.getParameterValue(0);
		
		if (root != null){
			
			String key = null;
			
			int i = 0;
			
			while ((key = (String)parameterContext.getParameterValue(++ i))!= null){
				
				parameterContext.setParameter(++ i, root.attributeValue(key));
			}
		}
		
	}
}